//时间全局混淆
import * as tools from "@/libs/tools";

let mixin = {
  data() {
    return {
      startTimeOption: {},
      endTimeOption: {}
    };
  },

  methods: {
    onStartTimeChange(startTime) {
      this.endTimeOption = {
        disabledDate(endTime) {
          return endTime < new Date(startTime);
        }
      };
    },
    onEndTimeChange(endTime) {
      this.startTimeOption = {
        disabledDate(startTime) {
          return startTime > new Date(endTime);
        }
      };
    },

    UTC(obj, type) {
      let time = tools.getDate(new Date(obj).getTime() / 1000, type);
      return time;
    }
  }
};

export default mixin;
